# !/usr/bin/env python
# coding=utf-8
# @Time    : 2017/12/21 16:04
# @Author  : 6imensiva
# @Site    : https://gitee.com/dimensiva/wx_server_prototype.git
# @File    : user_service.py
# @Software: PyCharm
# @Version: 3.5.4
from configs import current_config
from utils import my_request
from app.common import my_response


def get_user_info(token, openid):
	url = current_config.USER_INFO_URL % (token, openid)
	ret_dict = my_request.my_request4('GET', url, parse_format='json')
	if 'errmsg' in ret_dict:
		return my_response.fail(ret_dict['errmsg'])
	return my_response.success(ret_dict)